/*
 * @Description: 路由定义
 * @Autor: lcz
 * @LastEditors: lcz
 * @LastEditTime: 2025-07-05 14:00:54
 */
import { lazy } from "react";

const BaseLayout = lazy(() => import("@/layouts/baseLayout/index"));
const NoLoginLayout = lazy(() => import("@/layouts/noLoginLayout/index"));

const Login = lazy(() => import("@/views/user/login"));
const Home = lazy(() => import("@/views/home"));
const Search = lazy(() => import("@/views/search"));
const VList = lazy(() => import("@/views/VList"));

const error = lazy(() => import("@/views/404"));

const TestPage = lazy(() => import("@/views/testPages"));

const routes = [
  {
    path: "/",
    element: BaseLayout,
    children: [
      {
        path: "/home",
        element: Home
      },
      {
        path: "/search",
        element: Search
      },
      {
        path: "/vList",
        element: VList
      },
      {
        path: "/test",
        element: TestPage
      },
      {
        path: "/404",
        element: error
      }
    ]
  },
  {
    path: "/",
    element: NoLoginLayout,
    children: [
      {
        path: "/login",
        element: Login
      }
    ]
  },
  {
    path: "/404",
    element: error
  }
];

export default routes;
